1. Field of the Invention
The present invention relates to a table recognition apparatus that recognizes an image of a table from a table-character mixture in order to extract a structure of rows and columns from the recognized table image.
2. Description of the Prior Art
Typical prior art table recognition methods involve converting the marginal distribution of a table region or the ruled lines constituting the table into vector segments so as to reconstruct a rectangular frame enclosed by the ruled lines. A typical method of table recognition utilizing marginal distribution is disclosed in Japanese Patent Laid-Open No. HEI/2-61775, and a representative method based on the use of ruled lines converted to vector segments is disclosed in Japanese Patent Laid-Open No. HEI/1-129358. Using marginal distribution, the former method disclosed first extracts the outermost ruled lines of a target table. The table is then divided into a plurality of rectangular frames formed by ruled lines whose ends contact the two outermost ruled lines on both sides. Each of the rectangular frames thus formed is divided repeatedly in like manner until all rectangular frames in the table are recognized. The latter method disclosed examines the positional relations between rectangular frames extracted by tracing the vector segments obtained, so as to recognize the target table.
The precondition for the above two prior art methods to work is that the table should be composed of whole ruled lines, i.e., no part of the ruled lines should be omitted. In this respect, the method disclosed in Japanese Patent Laid-Open No. HEI/2-264386 allows rectangular frames within a table to be recognized even if the two outermost ruled lines on both sides are missing. This method involves initially extracting vertical and horizontal ruled lines from the image of a target table and checking to see if there exist the outermost ruled lines on both sides of the table. If those ruled lines are absent, they are generated virtually.
The preceding prior art method applies to cases where all rules lines are provided or where only the outermost ruled lines on both sides of the table are omitted. That is, the method is applicable to the cases of FIGS. 2 (a) and 2 (b), but not to the cases of FIGS. 2 (c) through 2 (e). Meanwhile, Japanese Patent Laid-Open No. HEI/3-142691 discloses yet another method that is applicable to cases such as that in FIG. 2 (c). According to this method, the ruled lines omitted between character columns are supplemented on a virtual basis.
However, where the table has rows or lines nested as shown in FIGS. 2 (d) and 2 (e), it becomes necessary to examine the image of the table more closely so as to detect contiguous blank regions. This entails prolonging the processing time. In recognizing the structure of rows and columns making up the table, the above prior art method presupposes a representative point (center point or center of gravity) in each of components constituting the table, and detects the distances between such representative points in the row or column direction so as to extract the rows and lines. Specifically, the distance between any two contiguous points of all representative points involved is checked. If the distance is found to be less than a predetermined threshold value, then a row or column is recognized and extracted. One disadvantage of this prior art method is that the components of the table, usually character blocks, may not be sufficiently aligned for precise extraction of rows and columns.
Another disadvantage of the prior art is that the primary object thereof is to distinguish character portions so that the characters in the table will be recognized precisely by optical character reader (OCR); recognizing and storing the structure of the table itself is not the object. No matter how much content of the table is omitted, all that is needed from the standpoint of the prior art is for character-filled regions to be specified. In other words, omitted parts of the table structure need not be input to OCR and may thus be ignored. This cannot be the case if the table needs to be recognized and input to word processing apparatuses for further use. For example, if the table structure is constituted by horizontal ruled lines alone as depicted in FIG. 2 (e), the omissions make it difficult to extract the row-column construction of the table, and hence to reconstitute precisely the entire structure of the table.